/**
 * @望京、电子城、华贸服务
 * 
 * */
var url=document.URL;
var commname;
var dzc_service;
var ssqy = "HM";
var cnt;
if(url.lastIndexOf("?")>0){  
	var s = url.search("&from");
	if(s != -1){
		url = url.substring(0,s);
	}
	para=url.substring(url.lastIndexOf("?")+1,url.length);	
	var arr=para.split("&");
	if(arr.length == 1){
		commname = decodeURI(arr[0].split("=")[1].replace("#",""));
	}
	if(arr.length == 2){
		commname = decodeURI(arr[0].split("=")[1]);
		cnt = decodeURI(arr[1].split("=")[1].replace("#",""));
	}
	
	}
if(commname == "华贸中心"){
	//serviceaddress("HM2","Mod_HM","DOM_hm","DEM_hm","Model_HM","HM");
	//serviceaddress1();
	if(cnt == 1){
		serviceaddress2("HM_PC");//6+12组合
	}else if(cnt == 2){
		serviceaddress2("HM_PC2");//6
	}else if(cnt == 0){
		serviceaddress3("ceshi2");//6+12
	}
	
}else if(commname == "金长安大厦"){
	serviceaddress("jca","Mod_jca","金长安大厦","北京朝阳_DEM","CY04建筑","jca");
}else{
	//serviceaddress("HM2","Mod_HM","DOM_hm","DEM_hm","Model_HM","HM");
	//serviceaddress2("HM_PC");
	if(cnt == 1){
		serviceaddress2("HM_PC2");//6
	}else if(cnt == 2){
		serviceaddress2("HM_PC2");//6+12
	}else if(cnt == 0){
		serviceaddress3("ceshi2");//6+12
	}else{
		serviceaddress2("HM_PC2");//6
	}
}
/**
 *  function : 根基不同服务地址加载不同服务
 *  servicename : 发布三维场景的名称
 *  modelname ： 建筑物模型的名字
 *  dom ： dom的名字
 *  dem : 地形
 *  dataname ： 数据集的名字
 *  datasetname : 数据服务中数据名字
 */
function serviceaddress1(){
	 dzc_service={
			service:{
				sceneAddress:"http://113.140.80.242:8090/iserver/services/3D-HM2/rest/realspace",//rest服务地址
				serverurl:"http://113.140.80.242:8090/iserver/services/data-HM/rest/data",//数据服务地址
				serverurlsys:"http://113.140.80.242:8090/iserver/services/spatialAnalysis-HM/restjsr/spatialanalyst",
				name:"HM"
			},
			serverurllayers : {
				Model : {	
					'HM' : 'http://113.140.80.242:8090/iserver/services/3D-HM/rest/realspace/datas/Model_HM@ModelData/config'	
				},
				
				Dom : {
					'HM' : "http://113.140.80.242:8090/iserver/services/3D-HM/rest/realspace/datas/DOM_hm@BaseData"
				},
				
				imageWhiteBase : "http://113.140.80.242:8090/iserver/services/3D-HM/rest/realspace/datas/WhiteBase@BaseData",//
				
				terrain : "http://113.140.80.242:8090/iserver/services/3D-HM/rest/realspace/datas/DEM_hm@BaseData",
				Household:"http://113.140.80.242:8090/iserver/services/3D-HM/rest/realspace/datas/Household@AttachData/config", //户
				
				floor :"http://113.140.80.242:8090/iserver/services/3D-HM2/rest/realspace/datas/Floor@AttachData/config"
			},
			layers:{
				
				Model : {
					'DZC' : 'Mod_DZC@ModelData',//DZC纹理模型
					'HM' : 'Mod_HM@ModelData',//HM纹理模型
					//'HM' : 'Model_HM@ModelData',//HM纹理模型
					'WJ' : 'Mod_WJ@ModelData'//WJ纹理模型
				},
				Build : {
					'DZC' : 'Build_DZC@WhiteData',//DZC白模图层
					'HM' : 'Build_HM@WhiteData',//HM白模图层
					'WJ' : 'Build_WJ@WhiteData'//WJ白模图层
				},
				Dom : {
					'DZC' :'DOM_dzc@BaseData',//dzcDOM图层
					'HM' : 'DOM_hm@BaseData',//hmDOM图层
					'WJ' : 'DOM_wj@BaseData'//wjDOM图层
				},
					layerhousehold:"Household@AttachData",//户图层
					layercommitry:"Community@AttachData",//小区图层
					layerunderside:"Underside@AttachData",//underside图层
					layerBase:"WhiteBase@BaseData"
			},
			datalayers:{
				Model : {
					'DZC' : 'ModelData:Mod_DZC',//DZC纹理模型
					//'HM' : 'ModelData:Mod_HM',//HM纹理模型
					'HM' : 'ModelData:Model_HM',//HM纹理模型
					'WJ' : 'ModelData:Mod_WJ'//WJ纹理模型
				},
				Build : {
					'DZC' : 'WhiteData:Build_DZC',//DZC白模图层
					'HM' : 'WhiteData:Build_HM',//HM白模图层
					'WJ' : 'WhiteData:Build_WJ'//WJ白模图层
				},
				layerhousehold:"AttachData:Household",//户图层
				layercommitry:"AttachData:Community",//小区图层
				layerunderside:"AttachData:Underside"//underside图层
			}
	}
}
function serviceaddress(servicename,modelname,dom,dem,dataname,datasetname){

	dzc_service={
			service:{//http://localhost:8090/iserver/services/3D-bjcy/rest/realspace
				sceneAddress:"http://113.140.80.242:8090/iserver/services/3D-"+servicename+"/rest/realspace",//rest服务地址
				serverurl:"http://113.140.80.242:8090/iserver/services/data-"+datasetname+"/rest/data",//数据服务地址
				serverurlsys:"http://113.140.80.242:8090/iserver/services/spatialAnalysis-"+datasetname+"/restjsr/spatialanalyst",
				name:"HM"
			},
			serverurllayers : {
				Model : {
					'HM' : "http://113.140.80.242:8090/iserver/services/3D-"+servicename+"/rest/realspace/datas/"+modelname+"@ModelData/config"
				},
				Dom : {
					'HM' : "http://113.140.80.242:8090/iserver/services/3D-"+servicename+"/rest/realspace/datas/"+dom+"@BaseData"
				},
				imageWhiteBase : "http://113.140.80.242:8090/iserver/services/3D-"+servicename+"/rest/realspace/datas/WhiteBase@BaseData",//
				terrain : "http://113.140.80.242:8090/iserver/services/3D-"+servicename+"/rest/realspace/datas/"+dem+"@BaseData",
				Household:"http://113.140.80.242:8090/iserver/services/3D-"+servicename+"/rest/realspace/datas/Household@AttachData/config", //户
				floor :"http://113.140.80.242:8090/iserver/services/3D-"+servicename+"/rest/realspace/datas/Floor@AttachData/config"
			},
			layers:{
				Model : {
					//'HM' : 'Mod_HM@ModelData',//HM纹理模型
					'HM' : modelname+'@ModelData'//HM纹理模型
				},
					layerhousehold:"Household@AttachData",//户图层
					layercommitry:"Community@AttachData",//小区图层
					layerunderside:"Underside@AttachData",//underside图层
					layerBase:"WhiteBase@BaseData"
			},
			datalayers:{
				Model : {
					'HM' : 'ModelData:'+dataname,//HM纹理模型
					//'HM' : 'ModelData:Model_HM'//HM纹理模型   
				},
				layerhousehold:"AttachData:Household",//户图层
				layercommitry:"AttachData:Community",//小区图层
				layerunderside:"AttachData:Underside"//underside图层
			}
	}
}
function serviceaddress2(servicename){
	dzc_service={
			service:{//http://113.140.80.242:8090/iserver/services/3D-HM2/rest
				sceneAddress:"http://113.140.80.242:8090/iserver/services/3D-"+servicename+"/rest/realspace",//rest服务地址
				serverurl:"http://113.140.80.242:8090/iserver/services/data-Android/rest/data",//数据服务地址
				serverurlsys:"http://113.140.80.242:8090/iserver/services/spatialAnalysis-Android/restjsr/spatialanalyst",
				name:"HM"
			},
			serverurllayers : {
				Model : {
					'HM' : 'http://113.140.80.242:8090/iserver/services/3D-'+servicename+'/rest/realspace/datas/JZ6@20190412北京_WGS84/config',
					'HM12':'http://113.140.80.242:8090/iserver/services/3D-'+servicename+'/rest/realspace/datas/JZ12@20190412北京_WGS84/config',
					'HM6' : 'http://113.140.80.242:8090/iserver/services/3D-'+servicename+'/rest/realspace/datas/JZ6@20190412北京_WGS84_1/config'
					//'HM' :'http://113.140.80.242:8090/iserver/services/3D-HM2/rest/realspace/datas/Mod_HM@ModelData/config'
				},
				Dom : {
					'HM' : "http://113.140.80.242:8090/iserver/services/3D-Android/rest/realspace/datas/底图_wgs84@20190412北京_WGS84"
					//'HM':"http://113.140.80.242:8090/iserver/services/3D-HM2/rest/realspace/datas/DOM_hm@BaseData"
				},
				imageWhiteBase : "http://113.140.80.242:8090/iserver/services/3D-HM/rest/realspace/datas/WhiteBase@BaseData",//
				terrain : "http://113.140.80.242:8090/iserver/services/3D-"+servicename+"/rest/realspace/datas/dem_wgs84@20190412北京_WGS84",
				Household:"http://113.140.80.242:8090/iserver/services/3D-HM/rest/realspace/datas/Household@AttachData/config", //户
				floor :"http://113.140.80.242:8090/iserver/services/3D-HM2/rest/realspace/datas/Floor@AttachData/config"
			},
			layers:{
				Model : {
					'DZC' : 'Mod_DZC@20190404北京_WGS84',//DZC纹理模型
					'HM' : 'JZ6@20190412北京_WGS84',//HM纹理模型
					//'HM' : 'Model_HM@ModelData',//HM纹理模型
					'HM1' : 'Model_HM@ModelData',//HM纹理模型
					'WJ' : 'Mod_WJ@20190404北京_WGS84'//WJ纹理模型
				},
				Build : {
					'DZC' : 'Build_DZC@WhiteData',//DZC白模图层
					'HM' : 'Build_HM@WhiteData',//HM白模图层
					'WJ' : 'Build_WJ@WhiteData'//WJ白模图层
				},
				Dom : {
					'DZC' :'DOM_dzc@BaseData',//dzcDOM图层
					'HM' : 'DOM_hm@BaseData',//hmDOM图层
					'WJ' : 'DOM_wj@BaseData'//wjDOM图层
				},
					layerhousehold:"Household@AttachData",//户图层
					layercommitry:"Community@AttachData",//小区图层
					layerunderside:"Underside@AttachData",//underside图层
					layerBase:"WhiteBase@BaseData"
			},
			datalayers:{
				Model : {
					'DZC' : 'ModelData:Mod_DZC',//DZC纹理模型
					//'HM' : 'ModelData:Mod_HM',//HM纹理模型
					'HM' : '20190412北京_WGS84:JZ6',//HM纹理模型
					'HM1' : 'ModelData:Model_HM',//HM纹理模型
					'WJ' : 'ModelData:Mod_WJ'//WJ纹理模型
				},
				Build : {
					'DZC' : 'WhiteData:Build_DZC',//DZC白模图层
					'HM' : 'WhiteData:Build_HM',//HM白模图层
					'WJ' : 'WhiteData:Build_WJ'//WJ白模图层
				},
				layerhousehold:"AttachData:Household",//户图层
				layercommitry:"AttachData:Community",//小区图层
				layerunderside:"AttachData:Underside"//underside图层
			}
	}
}
function serviceaddress3(servicename){
	dzc_service={
			service:{//http://113.140.80.242:8090/iserver/services/3D-HM2/rest
				sceneAddress:"http://113.140.80.242:8090/iserver/services/3D-"+servicename+"/rest/realspace",//rest服务地址
				serverurl:"http://113.140.80.242:8090/iserver/services/data-Android/rest/data",//数据服务地址
				serverurlsys:"http://113.140.80.242:8090/iserver/services/spatialAnalysis-Android/restjsr/spatialanalyst",
				name:"HM"
			},
			serverurllayers : {
				Model : {
					'HM' : 'http://113.140.80.242:8090/iserver/services/3D-'+servicename+'/rest/realspace/datas/JZ6@20190412北京_WGS84_1/config',
					'HM12':'http://113.140.80.242:8090/iserver/services/3D-'+servicename+'/rest/realspace/datas/JZ12@20190412北京_WGS84/config',
					'HM1' :'http://113.140.80.242:8090/iserver/services/3D-HM2/rest/realspace/datas/Mod_HM@ModelData/config'
				},
				Dom : {
					'HM' : "http://113.140.80.242:8090/iserver/services/3D-Android/rest/realspace/datas/底图_wgs84@20190412北京_WGS84"
					//'HM':"http://113.140.80.242:8090/iserver/services/3D-HM2/rest/realspace/datas/DOM_hm@BaseData"
				},
				imageWhiteBase : "http://113.140.80.242:8090/iserver/services/3D-HM/rest/realspace/datas/WhiteBase@BaseData",//
				terrain : "http://113.140.80.242:8090/iserver/services/3D-HM_PC2/rest/realspace/datas/dem_wgs84@20190412北京_WGS84",
				Household:"http://113.140.80.242:8090/iserver/services/3D-HM/rest/realspace/datas/Household@AttachData/config", //户
				floor :"http://113.140.80.242:8090/iserver/services/3D-HM2/rest/realspace/datas/Floor@AttachData/config"
			},
			layers:{
				Model : {
					'DZC' : 'Mod_DZC@20190404北京_WGS84',//DZC纹理模型
					'HM' : 'JZ6@20190412北京_WGS84',//HM纹理模型
					'HM1' : 'Model_HM@ModelData',//HM纹理模型
					'WJ' : 'Mod_WJ@20190404北京_WGS84'//WJ纹理模型
				},
				Build : {
					'DZC' : 'Build_DZC@WhiteData',//DZC白模图层
					'HM' : 'Build_HM@WhiteData',//HM白模图层
					'WJ' : 'Build_WJ@WhiteData'//WJ白模图层
				},
				Dom : {
					'DZC' :'DOM_dzc@BaseData',//dzcDOM图层
					'HM' : 'DOM_hm@BaseData',//hmDOM图层
					'WJ' : 'DOM_wj@BaseData'//wjDOM图层
				},
					layerhousehold:"Household@AttachData",//户图层
					layercommitry:"Community@AttachData",//小区图层
					layerunderside:"Underside@AttachData",//underside图层
					layerBase:"WhiteBase@BaseData"
			},
			datalayers:{
				Model : {
					'DZC' : 'ModelData:Mod_DZC',//DZC纹理模型
					//'HM' : 'ModelData:Mod_HM',//HM纹理模型
					'HM1' : 'ModelData:Model_HM',//HM纹理模型
					'HM' : '20190412北京_WGS84:JZ6',//HM纹理模型
					'WJ' : 'ModelData:Mod_WJ'//WJ纹理模型
				},
				Build : {
					'DZC' : 'WhiteData:Build_DZC',//DZC白模图层
					'HM' : 'WhiteData:Build_HM',//HM白模图层
					'WJ' : 'WhiteData:Build_WJ'//WJ白模图层
				},
				layerhousehold:"AttachData:Household",//户图层
				layercommitry:"AttachData:Community",//小区图层
				layerunderside:"AttachData:Underside"//underside图层
			}
	}
}